package org.one.stone.soup.grfxML;

/*
 * Copyright 2000-2001 Wet-Wired.com Ltd.,
 * Portsmouth England
 * All rights reserved.
 */

/**
	*
	* @author Nik Cross
*/
public class NameHelper {
	public static final String PLUGIN_DEFAULT_PACKAGE_NAME = "org.one.stone.soup.grfxML.plugin";
	public static final String PACKAGE_NAME = "org.one.stone.soup.grfxML.Data";
	public static final String BUILD_METHOD = "buildFromgrfxML";
	public static final String XML_ELEMENT = "org.one.stone.soup.xml.XmlElement";
	public static Class[] BUILD_SIG = null;

	static{
		try{
			BUILD_SIG = new Class[]{ Class.forName(XML_ELEMENT) };
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
public static boolean isAbsoluteName(String name) {
	if(name==null)
		return true;

	if(name.charAt(0)=='.')
		return true;
	else
		return false;
}
public static boolean isGenericName(String name) {
	if(name==null)
		return true;

	if(name.charAt(0)=='*')
		return true;
	else
		return false;
}
public static boolean isReadOnlyName(String name) {
	if(name==null)
		return true;

	if(name.charAt(0)=='!')
		return true;
	else
		return false;
}
public static boolean isReferenceName(String name) {
	if(name==null)
		return true;

	if(name.charAt(0)=='#')
		return true;
	else
		return false;
}
public static boolean isSystemName(String name) {
	if(name==null || name.length()==0)
		return true;

	if(name.charAt(0)=='_')
		return true;
	else
		return false;
}
public static String systemToTagName(String name) {

	String newName = name.substring(1,2).toLowerCase()+name.substring(2);
	return newName;
}
public static String toClassName(String name) {

	String newName = name.substring(0,1).toUpperCase()+name.substring(1);
	return PACKAGE_NAME+newName;
}
public static String toTagName(String name) {

	String newName = name.substring(0,1).toLowerCase()+name.substring(1);
	return newName;
}
}
